/**
 * 
 */
package com.alphasystem.commerce.common;

import java.util.ArrayList;
import java.util.List;

/**
 * @author sali
 * 
 */
public abstract class ApplicationException extends Exception {

	private static final long serialVersionUID = 878652364903363864L;

	protected List<ErrorCode> codes = new ArrayList<ErrorCode>();

	public ApplicationException() {
	}

	public ApplicationException(ErrorCode e) {
		codes.add(e);
	}

	public ApplicationException(ErrorCode e, Throwable cause) {
		super(cause);
		codes.add(e);
	}

	public ApplicationException(Throwable cause) {
		super(cause);
	}

	public boolean add(ErrorCode e) {
		return codes.add(e);
	}

	public List<ErrorCode> getCodes() {
		return codes;
	}

	public boolean remove(Object o) {
		return codes.remove(o);
	}

	public void setCodes(List<ErrorCode> codes) {
		this.codes = codes;
	}

}
